/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.mes.action.produce.flow;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.mes.mapper.produce.flow.ProducePlanMapper;
public class ProducePlan extends BaseAction
{
    @Autowired(required=false)
	private ProducePlanMapper mapper;
    /**
    统计图
    */
    
    public Map cartogramProductionPlan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        super.listDepartments();
        
        
        result.put("s_search", pagination.getSearchParas());
        
        
        SQLList<SQLMap> all=mapper.all(params);
        result.put("all", all);
        
        return result;
    }
    /**
    */
    
    public Object s_plan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> p_plan=mapper.p_plan(params,pagination);
        p_plan.setPagedListInfo(pagination);
        result.put("p_plan", p_plan);
        
        return p_plan;
    }
    /**
    饼状统计图
    */
    
    public Map pancakeProcess() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        SQLList<SQLMap> s_c=mapper.s_c(params);
        result.put("s_c", s_c);
        
        return result;
    }
    /**
    生产步骤表
    */
    
    public Map produceStep() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> s_next=mapper.s_next(params);
        result.put("s_next", s_next);
        
        return result;
    }
    /**
    工序执行流流程图
    */
    
    public Map processDiagram() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        return result;
    }
    /**
    计划明细
    */
    
    public Map producePlanDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_work=mapper.t_work(params);
        SQLMap t_work_emt=t_work.getExistfirst();
        result.put("t_work", t_work_emt);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> menus=mapper.menus(params);
        result.put("menus", menus);
        
        
        
        
        
        
        SQLList<SQLMap> tree_steps=mapper.tree_steps(params);
        result.put("tree_steps", tree_steps);
        
        return result;
    }
    /**
    采购明细
    */
    
    public Map purchaseDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_stuff=mapper.s_stuff(params);
        result.put("s_stuff", s_stuff);
        
        return result;
    }
    /**
    加工明细
    */
    
    public Map machDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        SQLMap s_layout_item_emt=s_layout_item.getExistfirst();
        result.put("s_layout_item", s_layout_item_emt);
        
        
        SQLList<SQLMap> s_stuff=mapper.s_stuff(params);
        result.put("s_stuff", s_stuff);
        
        return result;
    }
    /**
    装配明细
    */
    
    public Map assembleDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        SQLMap s_layout_item_emt=s_layout_item.getExistfirst();
        result.put("s_layout_item", s_layout_item_emt);
        
        
        SQLList<SQLMap> s_stuff=mapper.s_stuff(params);
        result.put("s_stuff", s_stuff);
        
        return result;
    }
    /**
    设置时间
    */
    
    public Map setTime() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_hour=mapper.s_hour(params);
        s_hour.setSelectNone("请选择");
        result.put("s_hour", s_hour);
        
        
        SQLList<SQLMap> s_minute=mapper.s_minute(params);
        s_minute.setSelectNone("请选择");
        result.put("s_minute", s_minute);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        return result;
    }
    /**
    批量设置时间
    */
    
    public Map batchSetupTime() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_work=mapper.s_work(params);
        result.put("s_work", s_work);
        
        return result;
    }
    /**
    设置步骤人员
    */
    
    public Map settingPersonnel() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_item=mapper.t_item(params);
        SQLMap t_item_emt=t_item.getExistfirst();
        result.put("t_item", t_item_emt);
        
        return result;
    }
    /**
    设置阶段人员
    */
    
    public Map stagePersonnel() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_phase_work=mapper.t_phase_work(params);
        SQLMap t_phase_work_emt=t_phase_work.getExistfirst();
        result.put("t_phase_work", t_phase_work_emt);
        
        return result;
    }
    /**
    修改开始时间
    */
    
    public Map modificationStartTime() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> s_plan=mapper.s_plan(params);
        SQLMap s_plan_emt=s_plan.getExistfirst();
        result.put("s_plan", s_plan_emt);
        
        return result;
    }
    /**
    添加记录
    */
    
    public Map addRecordProcess() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        SQLList<SQLMap> s_work=mapper.s_work(params);
        SQLMap s_work_emt=s_work.getExistfirst();
        result.put("s_work", s_work_emt);
        
        
        Object CMIDprocess_id =mapper.CMIDprocess_id(params);
        result.put("CMIDprocess_id", CMIDprocess_id);
        
        
        SQLList<SQLMap> t_product=mapper.t_product(params);
        SQLMap t_product_emt=t_product.getExistfirst();
        result.put("t_product", t_product_emt);
        
        
        SQLList<SQLMap> s_file=mapper.s_file(params);
        result.put("s_file", s_file);
        
        
        SQLList<SQLMap> s_table=mapper.s_table(params);
        result.put("s_table", s_table);
        
        return result;
    }
    /**
    产品统计
    */
    
    public Map productstatisticsPro() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_plan=mapper.t_plan(params);
        SQLMap t_plan_emt=t_plan.getExistfirst();
        result.put("t_plan", t_plan_emt);
        
        
        
        
        SQLList<SQLMap> s_piece=mapper.s_piece(params,pagination);
        s_piece.setPagedListInfo(pagination);
        result.put("s_piece", s_piece);
        
        
        
        return result;
    }
    /**
    产品计件
    */
    
    public Map productCounting() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_plan=mapper.t_plan(params);
        SQLMap t_plan_emt=t_plan.getExistfirst();
        result.put("t_plan", t_plan_emt);
        
        
        SQLList<SQLMap> t_product=mapper.t_product(params);
        SQLMap t_product_emt=t_product.getExistfirst();
        result.put("t_product", t_product_emt);
        
        
        SQLList<SQLMap> s_piece=mapper.s_piece(params,pagination);
        s_piece.setPagedListInfo(pagination);
        result.put("s_piece", s_piece);
        
        
        SQLList<SQLMap> t_piece=mapper.t_piece(params);
        SQLMap t_piece_emt=t_piece.getExistfirst();
        result.put("t_piece", t_piece_emt);
        
        return result;
    }
    /**
    修改计件
    */
    
    public Map productCountingModify() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_piece=mapper.t_piece(params);
        SQLMap t_piece_emt=t_piece.getExistfirst();
        result.put("t_piece", t_piece_emt);
        
        return result;
    }
    /**
    查看计件
    */
    
    public Map productCountingView() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> t_piece=mapper.t_piece(params);
        SQLMap t_piece_emt=t_piece.getExistfirst();
        result.put("t_piece", t_piece_emt);
        
        return result;
    }
    /**
    执行工序
    */
    
    public Map executionProcedure() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        Object CMIDprocess_id =mapper.CMIDprocess_id(params);
        result.put("CMIDprocess_id", CMIDprocess_id);
        
        
        SQLList<SQLMap> t_product=mapper.t_product(params);
        SQLMap t_product_emt=t_product.getExistfirst();
        result.put("t_product", t_product_emt);
        
        
        SQLList<SQLMap> s_record_table=mapper.s_record_table(params);
        SQLMap s_record_table_emt=s_record_table.getExistfirst();
        result.put("s_record_table", s_record_table_emt);
        
        
        
        
        SQLList<SQLMap> s_file=mapper.s_file(params);
        result.put("s_file", s_file);
        
        return result;
    }
    /**
    查看工序
    */
    
    public Map procedureView() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        Object CMIDprocess_id =mapper.CMIDprocess_id(params);
        result.put("CMIDprocess_id", CMIDprocess_id);
        
        
        SQLList<SQLMap> t_product=mapper.t_product(params);
        SQLMap t_product_emt=t_product.getExistfirst();
        result.put("t_product", t_product_emt);
        
        
        SQLList<SQLMap> s_file=mapper.s_file(params);
        result.put("s_file", s_file);
        
        
        SQLList<SQLMap> s_record_work=mapper.s_record_work(params);
        SQLMap s_record_work_emt=s_record_work.getExistfirst();
        result.put("s_record_work", s_record_work_emt);
        
        
        SQLList<SQLMap> record=mapper.record(params);
        result.put("record", record);
        
        return result;
    }
    /**
    修改工序
    */
    
    public Map procedureModify() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        
        
        Object CMIDprocess_id =mapper.CMIDprocess_id(params);
        result.put("CMIDprocess_id", CMIDprocess_id);
        
        
        SQLList<SQLMap> t_product=mapper.t_product(params);
        SQLMap t_product_emt=t_product.getExistfirst();
        result.put("t_product", t_product_emt);
        
        
        SQLList<SQLMap> s_file=mapper.s_file(params);
        result.put("s_file", s_file);
        
        
        SQLList<SQLMap> s_record_work=mapper.s_record_work(params);
        SQLMap s_record_work_emt=s_record_work.getExistfirst();
        result.put("s_record_work", s_record_work_emt);
        
        
        SQLList<SQLMap> record=mapper.record(params);
        result.put("record", record);
        
        return result;
    }
    /**
    查看记录模板
    */
    
    public Map recordTemplate() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_record_table=mapper.s_record_table(params);
        SQLMap s_record_table_emt=s_record_table.getExistfirst();
        result.put("s_record_table", s_record_table_emt);
        
        return result;
    }
    /**
    查看对应采购数量
    */
    
    public Map purchaseSum() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_procurement_task=mapper.s_procurement_task(params);
        result.put("s_procurement_task", s_procurement_task);
        
        
        
        return result;
    }
    /**
    生产流程图
    */
    
    public Map produceFlow() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        return result;
    }
    /**
    采购流程
    */
    
    public Map purchaseFlow() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        return result;
    }
    /**
    指定任务开始时间
    */
    
    public Map appointBeginTime() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_produce_plan=mapper.s_produce_plan(params);
        SQLMap s_produce_plan_emt=s_produce_plan.getExistfirst();
        result.put("s_produce_plan", s_produce_plan_emt);
        
        
        
        
        
        return result;
    }
    /**
    生产甘特图
    */
    
    public Map produceGtt() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        
        params=new SQLParam(request);
        SQLList<SQLMap> gantt=mapper.gantt(params);
        tb = createTreeBean("gantt_treecols");
        tb.setPrefix("img");
        gantt.setTreeBean(tb);
        String ganttString=cn.javaxc.mvcwork.controller.MVCConfig.getTreeHelper().getGantt(gantt,(SQLList)request.getAttribute("skips"));
        result.put("ganttString", ganttString);
        
        return result;
    }
    /**
    工位甘特图
    */
    
    public Map stationGtt() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        
        params=new SQLParam(request);
        SQLList<SQLMap> gantt=mapper.gantt(params);
        tb = createTreeBean("gantt_treecols");
        tb.setPrefix("img");
        gantt.setTreeBean(tb);
        String ganttString=cn.javaxc.mvcwork.controller.MVCConfig.getTreeHelper().getGantt(gantt,(SQLList)request.getAttribute("skips"));
        result.put("ganttString", ganttString);
        
        return result;
    }
    /**
    指定工作周期
    */
    
    public Map appointCycle() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_lookup=mapper.s_lookup(params);
        result.put("s_lookup", s_lookup);
        
        return result;
    }
    /**
    刷新任务
    */
    
    public Map refreshTask() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        return result;
    }
    /**
    生产任务明细
    */
    
    public Map produceTaskDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_p=mapper.s_p(params);
        result.put("s_p", s_p);
        
        return result;
    }
    /**
    选择产品
    */
    
    public Map choiceProduct() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        params.def("category_id",-1);
        SQLList<SQLMap> produce=mapper.produce(params);
        produce.setSelectNone("produce备注");
        result.put("produce", produce);
        
        
        params.def("category_id",-1);
        SQLList<SQLMap> classid=mapper.classid(params);
        classid.setSelectNone("classid备注");
        result.put("classid", classid);
        
        
        params.def("category_id",-1);
        SQLList<SQLMap> cate=mapper.cate(params);
        SQLMap cate_emt=cate.getExistfirst();
        result.put("cate", cate_emt);
        
        
        
        
        
        
        SQLList<SQLMap> s_product=mapper.s_product(params);
        result.put("s_product", s_product);
        
        return result;
    }
    /**
    产生工序时间
    */
    
    public Map produceProcessTime() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> s_action_step_skip_s=mapper.s_action_step_skip_s(params);
        result.put("s_action_step_skip_s", s_action_step_skip_s);
        
        
        SQLList<SQLMap> s_action_step_skip=mapper.s_action_step_skip(params);
        result.put("s_action_step_skip", s_action_step_skip);
        
        return result;
    }
    /**
    流程明细.2013
    */
    
    public Map flowDetailed() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> produces_steps=mapper.produces_steps(params);
        result.put("produces_steps", produces_steps);
        
        
        tb = createTreeBean("tree_steps_treecols");
        tb.setPrefix("img");
        SQLList<SQLMap> tree_steps=mapper.tree_steps(params);
        tree_steps = tree_steps.buildTree(tb,tb.getPid());
        result.put("tree_steps", tree_steps);
        
        
        
        
        SQLList<SQLMap> s_img=mapper.s_img(params);
        result.put("s_img", s_img);
        
        return result;
    }
    /**
    修改流程
    */
    
    public Map flowUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> UserList=mapper.UserList(params);
        result.put("UserList", UserList);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        return result;
    }
    /**
    装配
    */
    
    public Map fit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        
        SQLList<SQLMap> s_pd_plan_digital=mapper.s_pd_plan_digital(params);
        result.put("s_pd_plan_digital", s_pd_plan_digital);
        
        
        SQLList<SQLMap> s_plan=mapper.s_plan(params);
        result.put("s_plan", s_plan);
        
        
        SQLList<SQLMap> s_deploy_no=mapper.s_deploy_no(params);
        result.put("s_deploy_no", s_deploy_no);
        
        
        SQLList<SQLMap> s_action_step_skip=mapper.s_action_step_skip(params);
        result.put("s_action_step_skip", s_action_step_skip);
        
        
        SQLList<SQLMap> produces_steps=new SQLList();
        result.put("produces_steps", produces_steps);
        
        
        SQLList<SQLMap> procurement_steps=mapper.procurement_steps(params);
        result.put("procurement_steps", procurement_steps);
        
        return result;
    }
    /**
    设置步骤时间
    */
    
    public Map stepTimeSet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_hour=mapper.s_hour(params);
        result.put("s_hour", s_hour);
        
        
        SQLList<SQLMap> s_minute=mapper.s_minute(params);
        result.put("s_minute", s_minute);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        return result;
    }
    /**
    调整生产瓶颈
    */
    
    public Map adjustBottleneck() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        return result;
    }
    /**
    添加下一步
    */
    
    public Map nextAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_layout_item=mapper.s_layout_item(params);
        result.put("s_layout_item", s_layout_item);
        
        
        
        return result;
    }
    /**
    调整跳转
    */
    
    public Map adjustJump() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        
        
        SQLList<SQLMap> l_step=mapper.l_step(params);
        result.put("l_step", l_step);
        
        
        SQLList<SQLMap> l_skipwork=mapper.l_skipwork(params);
        result.put("l_skipwork", l_skipwork);
        
        
        
        return result;
    }
    /**
    移动步骤
    */
    
    public Map stepMove() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> l_step=mapper.l_step(params);
        result.put("l_step", l_step);
        
        return result;
    }
    /**
    设置时间
    */
    
    public Map timeSet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_hour=mapper.s_hour(params);
        s_hour.setSelectNone("请选择");
        result.put("s_hour", s_hour);
        
        
        SQLList<SQLMap> s_minute=mapper.s_minute(params);
        s_minute.setSelectNone("请选择");
        result.put("s_minute", s_minute);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        return result;
    }
    /**
    */
    
    public Map d_plan() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_plan(params);
        
        return result;
    }
    /**
    生产步骤表修改
    */
    
    public Map produceStepSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step_skip")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_action_step_skip(params);
        }
        
        return result;
    }
    /**
    设置时间修改
    */
    
    public Map setTimeSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step_work")){
            params=new SQLParam(request,emt.getMap());
            mapper.setTimeSubmit(params);
        }
        
        return result;
    }
    /**
    批量设置时间修改
    */
    
    public Map batchSetupTimeSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.batchSetupTimeSubmit(params);
        }
        
        
        u_pro_time();
        
        return result;
    }
    /**
    转成生产流程时候，更新每一步预算时间
    */
    
    public Map u_pro_time() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        Object user_id =
        mapper.user_id(params);
        result.put("user_id", user_id);
        
        
        SQLList<SQLMap> t_user=mapper.t_user(params);
        SQLMap t_user_emt=t_user.getExistfirst();
        result.put("t_user", t_user_emt);
        
        
        SQLList<SQLMap> s_steps=mapper.s_steps(params);
        result.put("s_steps", s_steps);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        
        Object s_start_time =
        mapper.s_start_time(params);
        result.put("s_start_time", s_start_time);
        
        
        for (SQLMap emt:FrameHelper.createStepWorkTime(s_steps,skips,"item_work_id","dura_inttime")){
            params=new SQLParam(request,emt.getMap());
            params.put("_start_time",getAfterWorkHour(s_start_time,emt.getInt("start_inttime")*1.0/3600,t_user_emt.getString("station_type"),t_user_emt.getString("org_id")));
            params.put("_end_time",getAfterWorkHour(s_start_time,emt.getInt("end_inttime")*1.0/3600,t_user_emt.getString("station_type"),t_user_emt.getString("org_id")));
            mapper.b_step_work(params);
        }
        
        
        mapper.u_pro_time(params);
        
        return result;
    }
    /**
    设置步骤人员修改
    */
    
    public Map settingPersonnelSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.settingPersonnelSubmit(params);
        
        
        
        return result;
    }
    /**
    设置阶段人员修改
    */
    
    public Map stagePersonnelSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.stagePersonnelSubmit(params);
        
        return result;
    }
    /**
    修改开始时间修改
    */
    
    public Map modificationStartTimeSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.modificationStartTimeSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_step_work(params);
        }
        
        
        SQLList<SQLMap> s_steps=mapper.s_steps(params);
        result.put("s_steps", s_steps);
        
        
        SQLList<SQLMap> skips=mapper.skips(params);
        result.put("skips", skips);
        
        
        SQLList<SQLMap> t_user=mapper.t_user(params);
        SQLMap t_user_emt=t_user.getExistfirst();
        result.put("t_user", t_user_emt);
        
        
        for (SQLMap emt:FrameHelper.createStepWorkTime(s_steps,skips,"item_work_id","dura_inttime")){
            params=new SQLParam(request,emt.getMap());
            params.put("_start_time",getAfterWorkHour(getParameter("start_time"),emt.getInt("start_inttime")*1.0/3600,t_user_emt.getString("station_type"),t_user_emt.getString("org_id")));
            params.put("_end_time",getAfterWorkHour(getParameter("start_time"),emt.getInt("end_inttime")*1.0/3600,t_user_emt.getString("station_type"),t_user_emt.getString("org_id")));
            mapper.b_step_time(params);
        }
        
        return result;
    }
    /**
    添加记录修改
    */
    
    public Map addRecordProcessSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.addRecordProcessSubmit(params);
        
        return result;
    }
    /**
    */
    
    public Map d_piece() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_piece(params);
        
        return result;
    }
    /**
    增加计件修改
    */
    
    public Map productCountingAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_piece = mapper.i_piece(params);
        result.put("i_piece", i_piece);
        
        return result;
    }
    /**
    修改计件修改
    */
    
    public Map productCountingModifySubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.productCountingModifySubmit(params);
        
        return result;
    }
    /**
    执行工序修改
    */
    
    public Map executionProcedureSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMIDrecord_work_id = mapper.CMIDrecord_work_id(params);
        result.put("CMIDrecord_work_id", CMIDrecord_work_id);
        
        
        mapper.executionProcedureSubmit(params);
        
        
        for (SQLMap emt:SQL.foreach(hqlBean.getRecord(),"name","value")){
            params=new SQLParam(request,emt.getMap());
            if(SQL.isNotNull(params.get("value")))
            mapper.b_item_work(params);
        }
        
        
        
        
        
        return result;
    }
    /**
    */
    
    public Map onInsertFile() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        Object name =
        mapper.name(params);
        result.put("name", name);
        
        return result;
    }
    /**
    */
    
    public Map i_sub() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        u_check_work();
        
        
        mapper.i_sub(params);
        
        return result;
    }
    /**
    工艺工序流程下一步跳转
    */
    
    public Map u_check_work() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.u_check_work(params);
        
        return result;
    }
    /**
    修改工序修改
    */
    
    public Map procedureModifySubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.procedureModifySubmit(params);
        
        
        for (SQLMap emt:SQL.foreach(hqlBean.getRecord(),"name","value")){
            params=new SQLParam(request,emt.getMap());
            if(SQL.isNotNull(params.get("value")))
            mapper.b_item_work(params);
        }
        
        
        
        return result;
    }
    /**
    指定任务开始时间修改
    */
    
    public Map appointBeginTimeSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        params.def("hours","-1");
        int i_pd_plan_digital = mapper.i_pd_plan_digital(params);
        result.put("i_pd_plan_digital", i_pd_plan_digital);
        
        return result;
    }
    /**
    增加新计划修改
    */
    
    public Map planAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int CMID = mapper.CMID(params);
        result.put("CMID", CMID);
        
        
        int CMFLOWWORKID = mapper.CMFLOWWORKID(params);
        result.put("CMFLOWWORKID", CMFLOWWORKID);
        
        
        int CMID4 = mapper.CMID4(params);
        result.put("CMID4", CMID4);
        
        
        int action_work = mapper.action_work(params);
        result.put("action_work", action_work);
        
        return result;
    }
    /**
    修改流程修改
    */
    
    public Map flowUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step")){
            params=new SQLParam(request,emt.getMap());
            mapper.flowUpSubmit(params);
        }
        
        return result;
    }
    /**
    装配修改
    */
    
    public Map fitSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("pd_plan_digital")){
            params=new SQLParam(request,emt.getMap());
            mapper.i_pd_plan_digital(params);
        }
        
        return result;
    }
    /**
    设置步骤时间修改
    */
    
    public Map stepTimeSetSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step_work")){
            params=new SQLParam(request,emt.getMap());
            mapper.stepTimeSetSubmit(params);
        }
        
        return result;
    }
    /**
    添加下一步修改
    */
    
    public Map nextAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int work_id = mapper.work_id(params);
        result.put("work_id", work_id);
        
        
        int stepid = mapper.stepid(params);
        result.put("stepid", stepid);
        
        return result;
    }
    /**
    */
    
    public Map d_skip() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.d_skip(params);
        
        return result;
    }
    /**
    */
    
    public Map i_skip() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        int i_skip = mapper.i_skip(params);
        result.put("i_skip", i_skip);
        
        return result;
    }
    /**
    移动步骤修改
    */
    
    public Map stepMoveSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        mapper.stepMoveSubmit(params);
        
        return result;
    }
    /**
    设置时间修改
    */
    
    public Map timeSetSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("action_step_work")){
            params=new SQLParam(request,emt.getMap());
            mapper.timeSetSubmit(params);
        }
        
        return result;
    }
}